package com.dmx.platform.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TDetailinfo entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_detailinfo")
public class TDetailinfo implements java.io.Serializable {

	// Fields

	public static Integer STATUS_INPUTING=1;
	public static Integer STATUS_PUBLISHED=2;
	public static Integer STATUS_UNPUBLISHED=3;
	public static Integer STATUS_INVALID=4;
	
	private Integer detailId;
	private TBaseinfo TBaseinfo;
	private Integer parentId;
	private String mark;
	private String name;
	private Integer type;
	private Integer timeSeg;
	private Integer price;
	private Integer number;
	private Integer status;
	private String description;
	private Integer validDay;
	private Date recordTime;
	private Date startTime;
	private Date endTime;
	private List<TPricePlan> pricePlan=new ArrayList<TPricePlan>();

	// Constructors

	/** default constructor */
	public TDetailinfo() {
	}

	/** full constructor */
	public TDetailinfo(TBaseinfo TBaseinfo, Integer parentId, String mark,
			String name, Integer type, Integer timeSeg, Integer price,
			Integer number, Integer status, String description, String images,
			Integer validDay, Date recordTime) {
		this.TBaseinfo = TBaseinfo;
		this.parentId = parentId;
		this.mark = mark;
		this.name = name;
		this.type = type;
		this.timeSeg = timeSeg;
		this.price = price;
		this.number = number;
		this.status = status;
		this.description = description;
		this.validDay = validDay;
		this.recordTime = recordTime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "detail_id", unique = true, nullable = false)
	public Integer getDetailId() {
		return this.detailId;
	}

	public void setDetailId(Integer detailId) {
		this.detailId = detailId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "base_id")
	public TBaseinfo getTBaseinfo() {
		return this.TBaseinfo;
	}

	public void setTBaseinfo(TBaseinfo TBaseinfo) {
		this.TBaseinfo = TBaseinfo;
	}
	

	@Column(name = "parent_id")
	public Integer getParentId() {
		return this.parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	@Column(name = "mark", length = 50)
	public String getMark() {
		return this.mark;
	}

	public void setMark(String mark) {
		this.mark = mark;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "type")
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "time_seg")
	public Integer getTimeSeg() {
		return this.timeSeg;
	}

	public void setTimeSeg(Integer timeSeg) {
		this.timeSeg = timeSeg;
	}

	@Column(name = "price")
	public Integer getPrice() {
		return this.price;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}

	@Column(name = "number")
	public Integer getNumber() {
		return this.number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "description", length = 200)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}



	@Column(name = "valid_day")
	public Integer getValidDay() {
		return this.validDay;
	}

	public void setValidDay(Integer validDay) {
		this.validDay = validDay;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "record_time", length = 0)
	public Date getRecordTime() {
		return this.recordTime;
	}

	public void setRecordTime(Date recordTime) {
		this.recordTime = recordTime;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_time", length = 0)
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_time", length = 0)
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "ownerId")
	public List<TPricePlan> getPricePlan() {
		return pricePlan;
	}

	public void setPricePlan(List<TPricePlan> pricePlan) {
		this.pricePlan = pricePlan;
	}
	


}